import Http from "../utils/http";
import {formdata} from '../utils/util'
import Base from "./base"
class Opinion extends Base {
  // 专家 获取专家意见
  static getMessage(data) {
    return Http.request({
      url: `/opinion/getExpertOpinionInfo/${data}`, 
      method : 'GET',
    })
  }
  // 专家 附件列表
  static getMessageFiles(data) {
    return Http.request({
      url: `/minioApp/getFilesByOpinionId`, 
      data,
      method : 'GET',
    })
  }

  // 专家 删除附件
  static deleteFileOpinion(data) {
    return Http.request({
      url: `/minioApp/deleteFileOpinion`, 
      data: formdata(data),
      method : 'DELETE',
      header: {
        'content-type': 'multipart/form-data; boundary=XXX'
      },
    })
  }

  // 专家 修改专家意见 提交
  static updateExpertOpinion(data) {
    return Http.request({
        url: `/opinion/updateExpertOpinion`,
        data,
        method: 'POST'
    })
  }

  // 专家 讨论区列表 项目单位列表
  static getSponsorOpinionList(data) {
    return Http.request({
        url: '/opinion/selectSponsorOpinionList',
        data,
        method: 'POST'
    })
  }

  // 专家 讨论区列表 - 已填写详情
  static getSponsorOpinionDetail(data) {
    return Http.request({
        url: '/opinion/selectExpertOpinionByType',
        data,
        method: 'POST'
    })
  }

  // 新增意见
  static addDiscussOpinion(data) {
    return Http.request({
        url: '/opinion/addDiscussOpinion',
        data,
        method: 'POST'
    })
  }

  // 查询讨论意见列表
  static getDiscussOpinionList(data) {
    return Http.request({
        url: '/opinion/selectDiscussOpinionList',
        data,
        method: 'POST'
    })
  }
}

export default Opinion